home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / whdload / games / charliejcool.lha / CharlieJCoolHD / Install_ECS < prev    next >
Text File  |  1980-02-16  |  4KB  |  180 lines

  1. ;****************************
  2.  
  3. (set #readme-file "CharlieJCool.readme") ;name of readme file
  4. (set #last-disk 2)          ;amount of disks
  5. (set #disk-size 901120)     ;size of each disk
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;----------------------------
  23. ; Create disk-Image using DIC
  24. ; IN:  #dest        - DestinationPath
  25. ;      #CI_diskname - DiskName
  26. ;      #CI_diskno   - DiskNumber
  27. ;      #CI_drive    - DriveToReadFrom
  28. ; OUT: -
  29.  
  30. (procedure P_image
  31.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  32.   (if
  33.     (= 0 
  34.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno #disk-size))
  35.     )
  36.     ("")
  37.     (abort "\"DIC\" has failed to create a diskimage")
  38.   )
  39. )
  40.  
  41. ;****************************
  42.  
  43. (if
  44.   (exists #readme-file)
  45.   (if
  46.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  47.     ("")
  48.     (run ("SYS:Utilities/More %s" #readme-file))
  49.   )
  50. )
  51.  
  52. (set #program "WHDLoad")
  53. (P_chkrun)
  54.  
  55. (set #program "DIC")
  56. (P_chkrun)
  57.  
  58. ; in expert mode ask for source drive
  59. (if
  60.   (= @user-level 2)
  61.   (
  62.     (set #CI_drive
  63.       (askchoice
  64.     (prompt "Select source drive for diskimages")
  65.     (default 0)
  66.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  67.     (help @askchoice-help)
  68.       )
  69.     )
  70.     (select #CI_drive
  71.       (set #CI_drive "DF0:")
  72.       (set #CI_drive "DF1:")
  73.       (set #CI_drive "RAD:")
  74.       (set #CI_drive
  75.         (askstring
  76.           (prompt "Select source drive for diskimages")
  77.           (default "DF0:")
  78.           (help @askstring-help)
  79.         )
  80.       )
  81.     )
  82.   )
  83.   (set #CI_drive "DF0:")
  84. )
  85.  
  86. (set @default-dest
  87.   (askdir
  88.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  89.     (help @askdir-help)
  90.     (default @default-dest)
  91.     (disk)
  92.   )
  93. )
  94. (set #dest (tackon @default-dest @app-name))
  95. (if
  96.   (exists #dest)
  97.   (
  98.     (set #choice
  99.       (askbool
  100.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  101.         (default 1)
  102.         (choices "Delete" "Skip")
  103.         (help @askbool-help)
  104.       )
  105.     )
  106.     (if
  107.       (= #choice 1)
  108.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  109.     )
  110.   )
  111. )
  112. (makedir #dest
  113.   (help @makedir-help)
  114.   (infos)
  115. )
  116.  
  117. ;----------------------------
  118.  
  119. (copyfiles
  120.   (help @copyfiles-help)
  121.   (source ("CJC_ECS.slave" @app-name))
  122.   (newname ("%s.slave" @app-name))
  123.   (dest #dest)
  124. )
  125.  
  126. (if
  127.   (exists ("%s.newicon" @app-name))
  128.   (set #icon
  129.     (askchoice
  130.       (prompt "\nWhich icon do you like to install ?\n")
  131.       (default 0)
  132.       (choices "Normal" "NewIcon")
  133.       (help @askchoice-help)
  134.     )
  135.   )
  136.   (set #icon 0)
  137. )
  138. (select #icon
  139.   (set #icon ("%s.inf" @app-name))
  140.   (set #icon ("%s.newicon" @app-name))
  141. )
  142. (copyfiles
  143.   (help @copyfiles-help)
  144.   (source #icon)
  145.   (newname ("%s.info" @app-name))
  146.   (dest #dest)
  147. )
  148. (if
  149.   (exists #readme-file)
  150.   (copyfiles
  151.     (help @copyfiles-help)
  152.     (source #readme-file)
  153.     (dest #dest)
  154.     (infos)
  155.   )
  156. )
  157. (if
  158.   (exists ("%s.info" #readme-file))
  159.   (copyfiles
  160.     (help @copyfiles-help)
  161.     (source ("%s.info" #readme-file))
  162.     (dest #dest)
  163.   )
  164. )
  165.  
  166. (set #CI_diskno 1)
  167. (while
  168.   (<= #CI_diskno #last-disk)
  169.   (
  170.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  171.     (P_image)
  172.     (run ("FileNote Disk.%ld %s Quiet" #CI_diskno @app-name))
  173.     (set #CI_diskno (+ #CI_diskno 1))
  174.   )
  175. )
  176.  
  177. ;----------------------------
  178.  
  179. (exit)
  180.